www.gusucode.com > Matlab在化学工程中的应用 > Matlab在化学工程中的应用/实用化工计算机模拟-Matlab在化学工程中的应用/Examples/Chapter 9/HPLC_RB.m

    function HPLC_RB
% 用神经网络模拟HPLC流动相
%
%   Author: HUANG Huajiang
%   Copyright 2002 UNILAB Research Center, 
%   East China University of Science and Technology, Shanghai, PRC
%   $Revision: 1.0 $  $Date: 2003/03/5 $
%
%   [Ref] J. Zupan. and J. Gasteiger, Neural Networks for Chemists: 
%   Introduction. VCH, 1993. 中译本:J. Zupan. and J. Gasteiger著,
%   潘忠孝和陈玲然译,神经网络及其在化学中的应用,
%   合肥:中国科学技术大学出版社,2000

load HPLCdata
p = HPLCdata(:,1:2)';
t = HPLCdata(:,3)';

eg = 0.02; % sum-squared error goal.残差平方和指标
sc = 1;    % spread constant radial basis functions.径向基函数的分布常数
net = newrb(p,t,eg,sc);

% Simulate the network response for inputs over the same range:
PF = sim(net,p)
N = 30;
C = linspace(10,30,N); 
pH = linspace(5.0,6.0,N);
for i=1:N
    for j=1:N
        PF(i,j)=sim(net,[C(j);pH(i)])
    end
end
PFmax = max(max(PF))
[i,j] = find(PF==PFmax)
Copt = C(j)
pHopt = pH(i)
PFopt = sim(net,[Copt; pHopt])

surf(C,pH,PF)
xlabel('C, %')
ylabel('pH')
zlabel('PF')
title('模拟结果')